<?php

/**
 * PageStats filter form base class.
 *
 * @package    faceshop
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormFilterGeneratedTemplate.php 29570 2010-05-21 14:49:47Z Kris.Wallsmith $
 */
abstract class BasePageStatsFormFilter extends BaseFormFilterDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'views'                         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'likes'                         => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'admin_views'                   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'apply_form_count'              => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'apply_url_count'               => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'apply_email_count'             => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'apply_spontaneous_form_count'  => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'apply_spontaneous_url_count'   => new sfWidgetFormFilterInput(array('with_empty' => false)),
      'apply_spontaneous_email_count' => new sfWidgetFormFilterInput(array('with_empty' => false)),
    ));

    $this->setValidators(array(
      'views'                         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'likes'                         => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'admin_views'                   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'apply_form_count'              => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'apply_url_count'               => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'apply_email_count'             => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'apply_spontaneous_form_count'  => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'apply_spontaneous_url_count'   => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
      'apply_spontaneous_email_count' => new sfValidatorSchemaFilter('text', new sfValidatorInteger(array('required' => false))),
    ));

    $this->widgetSchema->setNameFormat('page_stats_filters[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'PageStats';
  }

  public function getFields()
  {
    return array(
      'page_id'                       => 'Number',
      'views'                         => 'Number',
      'likes'                         => 'Number',
      'admin_views'                   => 'Number',
      'apply_form_count'              => 'Number',
      'apply_url_count'               => 'Number',
      'apply_email_count'             => 'Number',
      'apply_spontaneous_form_count'  => 'Number',
      'apply_spontaneous_url_count'   => 'Number',
      'apply_spontaneous_email_count' => 'Number',
    );
  }
}
